n=input()
n=n.split(',')
temp=[]
sum=0
l=len(n)
for i in range(l):
    t=eval(n[i])
    temp.append(t)
    sum+=t
ave=sum/(l)
for i in range(l):
    if(temp[i]>ave):
        print("{}".format(temp[i]),end='')
weight=eval(input())
n=len(weights)
ave=sum(weights)/n
ls=[]
for i in range(n):
    if weight[i]>=ave:
        ls.append(weight[i])
for x in ls:
    print(x,end='')
